package com.ccl.iot.template;import android.content.Context;
import android.view.ViewGroup;

public class StandardView extends ViewGroup {

	public StandardView(Context context) {
		super(context);
	}

	@Override
	protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
		/*
		int tWidthMode = MeasureSpec.getMode(widthMeasureSpec);
		int tHeightMode = MeasureSpec.getMode(heightMeasureSpec);
		int tWidth = 0, tHeight = 0;
		String tWMode = (tWidthMode == MeasureSpec.UNSPECIFIED ? "Unspec" : (tWidthMode == MeasureSpec.AT_MOST ? "AtMost" : "Exactly"));
		String tHMode = (tHeightMode == MeasureSpec.UNSPECIFIED ? "Unspec" : (tHeightMode == MeasureSpec.AT_MOST ? "AtMost" : "Exactly"));
		
		tWidth = MeasureSpec.getSize(widthMeasureSpec);
		
		tHeight = MeasureSpec.getSize(heightMeasureSpec);
		
		Debugger.Debug("onMeasure : " + this.getClass().getSimpleName() + "(w=" + tWMode + ":" + tWidth + ", h=" + tHMode + ":" + tHeight + ")");
		*/
		int tCount = this.getChildCount();
		
		for (int i = 0; i < tCount; i++) {
			this.getChildAt(i).measure(MeasureSpec.UNSPECIFIED, MeasureSpec.UNSPECIFIED);
     	}
	 
     	super.onMeasure(widthMeasureSpec, heightMeasureSpec);
    }
	
	@Override
	protected void onLayout(boolean changed, int l, int t, int r, int b) {
		int tCount = this.getChildCount();
    	
        for (int i = 0; i < tCount; i++) {
            this.getChildAt(i).layout(l, t, r, b);
        }
	}

}
